import 'package:basic_common/common_exports.dart';
import 'package:basic_patient/childview/patienthealth/patient_health_controller.dart';
import 'package:basic_patient/childview/patienthealth/view/item_widget.dart';
import 'package:basic_widgets/bg_widget.dart';
import 'package:basic_widgets/text_widget.dart';


/// 基础信息
class BasicInfoWidget extends GetView<PatientHealthController> {
  const BasicInfoWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          Expanded(
            child: solidConnerContainer(
              width: ScreenHelper.screenWidth,
              height: ScreenHelper.screenHeight,
              bgColor: Colors.white,
              child: GetBuilder<PatientHealthController>(
                id: 'patientInfo',
                builder:(controller) => ListView.separated(
                shrinkWrap: true,
                itemBuilder: (BuildContext context, int index) {
                  Map item = controller.basicInfoList[index];
                  return buildItem(
                      attrName: item['attr'],
                      value: item['value'],
                      isHead: index == 0 ? true : false);
                },
                itemCount: controller.basicInfoList.length,
                separatorBuilder: (context, index) => divider(),
              ),),
            ),
          ),
          SizedBox(height: ScreenHelper.height(10)),
        ],
      ),
    );
  }
}
